home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / EModules / sound / sound.e next >
Encoding:
Text File  |  1997-11-30  |  3.6 KB  |  167 lines

  1. /*
  2. **  $VER: sound.e V0.9B
  3. **
  4. **  Sound definitions.
  5. **
  6. **  (C) Copyright 1996-1997 DreamWorld Productions.
  7. **      All Rights Reserved
  8. */
  9.  
  10. OPT MODULE
  11. OPT EXPORT
  12. OPT PREPROCESS
  13.  
  14. MODULE 'dpkernel/dpkernel'
  15.  
  16. /****************************************************************************
  17. ** Sound Object.
  18. */
  19.  
  20. CONST SMVERSION = 1
  21.  
  22. OBJECT sound
  23.   head[1]     :ARRAY OF head  /* Standard structure header */
  24.   lastchannel :INT            /* Channel (1 - ...) */
  25.   priority    :INT            /* Priority */
  26.   header      :PTR TO CHAR    /* Ptr to sample info header, if any */
  27.   data        :PTR TO CHAR    /* Address of sample data */
  28.   length      :LONG           /* Length of sample data in bytes */
  29.   octave      :INT            /* Octave/Note setting */
  30.   volume      :INT            /* Volume of sample (0 - 100) */
  31.   attrib      :LONG           /* Sound attributes (SBIT8/SBIT16) */
  32.   source      :LONG           /* File for the sound, if required */
  33.   frequency   :LONG           /* Frequency of sampled sound */       
  34. ENDOBJECT
  35.  
  36. CONST SA_Priority  = 14 OR TWORD,
  37.       SA_Header    = 16 OR TAPTR,
  38.       SA_Data      = 20 OR TAPTR,
  39.       SA_Length    = 24 OR TLONG,
  40.       SA_Octave    = 28 OR TWORD,
  41.       SA_Volume    = 30 OR TWORD,
  42.       SA_Attrib    = 32 OR TAPTR,
  43.       SA_Source    = 36 OR TAPTR,
  44.       SA_Frequency = 40 OR TLONG
  45.  
  46. /*** Flags for Attrib ***/
  47.  
  48. CONST SBIT8     = $00000000,  /* Sound data is 8 bit (1 byte) */
  49.       SBIT16    = $00000001,  /* Sound data is 16 bit (1 word) */
  50.       SMODVOL   = $00000002,  /* Modulate volume with next channel */ 
  51.       SMODPER   = $00000004,  /* Modulate period with next channel  */
  52.       SREPEAT   = $00000008,  /* Repeat sample forever */
  53.       SEMPTY    = $00000010,  /* Play only if channel is empty */
  54.       SLEFT     = $00000020,  /* Left speaker preferred */
  55.       SRIGHT    = $00000040,  /* Right speaker preferred */
  56.       SFORCE    = $00000080,  /* Enforce use of selected speaker */
  57.       SSTOPLAST = $00000100   /* Play sound only on given channel */
  58.  
  59. /*****************************************************************************
  60. ** Octave definitions for Sound->Octave.  An 'S' at the end of an octave
  61. ** definition indicates a sharp note.
  62. */
  63.  
  64. CONST OCT_G0S = 0,
  65.  OCT_G0  = 2,
  66.  OCT_F0S = 4,
  67.  OCT_F0  = 6,
  68.  OCT_E0  = 8,
  69.  OCT_D0S = 10,
  70.  OCT_D0  = 12,
  71.  OCT_C0S = 14,
  72.  OCT_C0  = 16,
  73.  OCT_B0  = 18,
  74.  OCT_A0S = 20,
  75.  OCT_A0  = 22,
  76.  
  77.  OCT_G1S = 24,
  78.  OCT_G1  = 26,
  79.  OCT_F1S = 28,
  80.  OCT_F1  = 30,
  81.  OCT_E1  = 32,
  82.  OCT_D1S = 34,
  83.  OCT_D1  = 36,
  84.  OCT_C1S = 38,
  85.  OCT_C1  = 40,
  86.  OCT_B1  = 42,
  87.  OCT_A1S = 44,
  88.  OCT_A1  = 46,
  89.  
  90.  OCT_G2S = 48,
  91.  OCT_G2  = 50,
  92.  OCT_F2S = 52,
  93.  OCT_F2  = 54,
  94.  OCT_E2  = 56,
  95.  OCT_D2S = 58,
  96.  OCT_D2  = 60,
  97.  OCT_C2S = 62,
  98.  OCT_C2  = 64,
  99.  OCT_B2  = 66,
  100.  OCT_A2S = 68,
  101.  OCT_A2  = 70,
  102.  
  103.  OCT_G3S = 72,
  104.  OCT_G3  = 74,
  105.  OCT_F3S = 76,
  106.  OCT_F3  = 78,
  107.  OCT_E3  = 80,
  108.  OCT_D3S = 82,
  109.  OCT_D3  = 84,
  110.  OCT_C3S = 86,
  111.  OCT_C3  = 88,
  112.  OCT_B3  = 90,
  113.  OCT_A3S = 92,
  114.  OCT_A3  = 94,
  115.  
  116.  OCT_G4S = 96,
  117.  OCT_G4  = 98,
  118.  OCT_F4S = 100,
  119.  OCT_F4  = 102,
  120.  OCT_E4  = 104,
  121.  OCT_D4S = 106,
  122.  OCT_D4  = 108,
  123.  OCT_C4S = 110,
  124.  OCT_C4  = 112,
  125.  OCT_B4  = 114,
  126.  OCT_A4S = 116,
  127.  OCT_A4  = 118,
  128.  
  129.  OCT_G5S = 120,
  130.  OCT_G5  = 122,
  131.  OCT_F5S = 124,
  132.  OCT_F5  = 126,
  133.  OCT_E5  = 128,
  134.  OCT_D5S = 130,
  135.  OCT_D5  = 132,
  136.  OCT_C5S = 134,
  137.  OCT_C5  = 136,
  138.  OCT_B5  = 138,
  139.  OCT_A5S = 140,
  140.  OCT_A5  = 142,
  141.  
  142.  OCT_G6S = 144,
  143.  OCT_G6  = 146,
  144.  OCT_F6S = 148,
  145.  OCT_F6  = 150,
  146.  OCT_E6  = 152,
  147.  OCT_D6S = 154,
  148.  OCT_D6  = 156,
  149.  OCT_C6S = 158,
  150.  OCT_C6  = 160,
  151.  OCT_B6  = 162,
  152.  OCT_A6S = 164,
  153.  OCT_A6  = 166,
  154.  
  155.  OCT_G7S = 168,
  156.  OCT_G7  = 170,
  157.  OCT_F7S = 172,
  158.  OCT_F7  = 174,
  159.  OCT_E7  = 176,
  160.  OCT_D7S = 178,
  161.  OCT_D7  = 180,
  162.  OCT_C7S = 182,
  163.  OCT_C7  = 184,
  164.  OCT_B7  = 186,
  165.  OCT_A7S = 188
  166.  
  167.